<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script type="text/javascript">
  
  let a = 1
  
  setTimeout(()=>{
    a = 2
  },1000)
  
  if(a === 1){
    console.log('ok1')
  }else if(a === 2){
    console.log('ok2')
  }else{
    console.log('no ok')
  }
  
</script>

</body>
</html>